{% extends "base.html" %}

{% block content %}
		<div id="name" style="margin: 30px;">
			<h1>Form sample</h1>
			<p>This form has been dynamically created from a database definition.<p>
			<strong>See the <a href="{% url form_collection %}">form collection demo</a>.</strong>
			
			{% if form.non_field_errors %}
				{{ form.non_field_errors.as_ul }}
			{% endif %}
			
			<form action="." method="post" accept-charset="utf-8" enctype="multipart/form-data">
				{% for field in form %}
					{% if not field.is_hidden %}
						<div class="form-row{% if field.field.required %} required{% endif %}">
							{{ field.errors }}
							{% if field.field.is_checkbox %}
								{{ field }} {{ field.label_tag }}
							{% else %}
								{{ field.label_tag }} {{ field }}
							{% endif %}
											
							{% if field.help_text %}
								<p>{{ field.help_text }}</p>
							{% endif %}
						</div>
					{% else %}
						{{ field }}
					{% endif %}
				{% endfor %}
				<p><input type="submit" value="Submit"></p>
			</form>
		</div>
{% endblock %}
